﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows.Forms;

namespace VersionComparer.Views
{
    public partial class AboutForm : Form
    {
        public AboutForm()
        {
            InitializeComponent();
            StartPosition = FormStartPosition.CenterParent;
        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.Enter || keyData == Keys.Escape)
            {
                Close();
                return true;
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

        private void AboutForm_Load(object sender, EventArgs e)
        {
            Text = Resources.Resources.AboutFormCaption;
            if (Owner != null)
                Icon = Owner.Icon;

            lblAppName.Text = Resources.Resources.AppName;
            lblHosting.Text = Resources.Resources.Hosting;
            lblAuthor.Text = Resources.Resources.Author;
            var version = Assembly.GetExecutingAssembly().GetName().Version;
            lblVersion.Text = string.Format("Version {0}.{1}", version.Major , version.Minor);
            pictureBox1.Image = Icon.ToBitmap();
        }

        private void btOk_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
